import numpy as np
from scipy.stats import shapiro
import pandas as pd
ages = np.array([1,5,10,40,36,12,58,62,77,36,89,100,89,18,20,25,30,32])
def is_normal_distribution(data):
       stat,p_value=shapiro(data)
       if p_value>0.05:
           return True
       else:
            return False

def check_outliers(date):
    # 平均值
    mean=np.mean(date)
    # 标准差
    std_dev=np.std(date)
    #检测是否超过3倍标准差，结果为异常值
    outliers=[x for x in date if abs(x-mean)>3*std_dev]
    if len(outliers)==0:
        return "没有异常值"
    else:
        return outliers
print(is_normal_distribution(ages))
print(check_outliers(ages))
